• File: common.js
  • Full Path: C:/htdocs/javascript/ion.rangeSlider-master/common.js
  • Date Modified: 04/30/2025 7:56 AM
  • File size: 2.59 KB
  • MIME-type: text/plain
  • Charset: utf-8
//=============================================================================
// Common functions for checking and likewise
//
// Copyright REEFT A/S - 2016-
//=============================================================================

//=============================================================================
// Is blank
//=============================================================================
function isBlank( id, value ) {
	
	if ( value == '' ) {
		returncode = false;
	} else {
		returncode = true;
	}
	return returncode
	
}

//=============================================================================
// Is zero
//=============================================================================
function isZero( id, value ) {
	
	if ( value == 0 ) {
		returncode = false;
	} else {
		returncode = true;
	}
	return returncode
	
}

//=============================================================================
// Is value numeric
//=============================================================================
function isNumeric( id, value ) {
	
	returncode = !isNaN(parseFloat($( id ).val())) && isFinite($( id).val());
	return returncode
	
}

//=============================================================================
// Is valid email
//=============================================================================
function isValidEmail( id, value ) {
	
	returncode = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test($(this).val())
	return returncode
	
}

//=============================================================================
// Is there selected an entry in a drop down
// The funcion will check that the selected item is not -1 (first elemenet in list)
//=============================================================================
function isDropDownSelected( id, value ) {
	
	var selectedValue = $("#tool-reference-dropdown option:selected").val();
	
	if ( selectedValue == '-1' ) {
		returncode = false;		
	} else {
		returncode = true;
	}
	
	return returncode
	
}

//=============================================================================
// Is there selected an entry in a drop down
// The funcion will check that the selected item is not -1 (first elemenet in list)
//=============================================================================
function isDropDownSelected( id, value ) {
	
	var selectedValue = $("#tool-reference-dropdown option:selected").val();
	
	if ( selectedValue == '-1' ) {
		returncode = false;		
	} else {
		returncode = true;
	}
	
	return returncode
	
}